Skip to contentSkip to conversation

Change in openvpn[master]: dco: mark peer as deleted from kernel after receiving CMD_DEL_PEER no...

Openvpn-devel In review ordex (Code Review) 2 participants 6 messages Sep 12, 2024 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1726132028000.Ife50e37cd49d55ec81a70319a524ffeaf0625a56@...2715...

#1 lore raw

Attention is currently required from: flichtenheld, plaisthos.

Hello plaisthos, flichtenheld,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/744?usp=email

to review the following change.

Change subject: dco: mark peer as deleted from kernel after receiving CMD_DEL_PEER notification
......................................................................

dco: mark peer as deleted from kernel after receiving CMD_DEL_PEER notification

some extra DCO calls may be made after receiving the DEL_PEER notification (i.e. due to timeout), but this will result in an error message due to the peer having disappeared already.

An extra call might be, for example, an explicit DEL_PEER in the attempt of cleaning the peer state.

For this reason, inform userspace that there is no peer in kernel anymore and prevent errors which may result confusing.

Change-Id Ife50e37cd49d55ec81a70319a524ffeaf0625a56

---
M src/openvpn/forward.c

1 file changed, 2 insertions(+), 0 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/44/744/1

src/openvpn/forward.c +2 -0
index 40b7cc4..374ba47 100644
@@ -1256,6 +1256,8 @@
     switch (dco->dco_message_type)
     {
         case OVPN_CMD_DEL_PEER:
+            /* peer is gone, unset ID to prevent more kernel calls */
+            c->c2.tls_multi->dco_peer_id = -1;
             if (dco->dco_del_peer_reason == OVPN_DEL_PEER_REASON_EXPIRED)
             {
                 msg(D_DCO_DEBUG, "%s: received peer expired notification of for peer-id "

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/744?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ife50e37cd49d55ec81a70319a524ffeaf0625a56
Gerrit-Change-Number: 744
Gerrit-PatchSet: 1
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newchange

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, ordex.

plaisthos has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/744?usp=email )

Change subject: dco: mark peer as deleted from kernel after receiving CMD_DEL_PEER notification
......................................................................

Patch Set 1: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/744?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ife50e37cd49d55ec81a70319a524ffeaf0625a56
Gerrit-Change-Number: 744
Gerrit-PatchSet: 1
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: ordex <[email protected]...>
Gerrit-Comment-Date: Thu, 12 Sep 2024 16:29:07 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

#3 lore raw

PATCH 1/1 dco: mark peer as deleted from kernel after receiving CMD_DEL_PEER notification

In reply to a message not in the archive

From: Antonio Quartulli <[email protected]...>

some extra DCO calls may be made after receiving the DEL_PEER notification (i.e. due to timeout), but this will result in an error message due to the peer having disappeared already.

An extra call might be, for example, an explicit DEL_PEER in the attempt of cleaning the peer state.

For this reason, inform userspace that there is no peer in kernel anymore and prevent errors which may result confusing.

Change-Id Ife50e37cd49d55ec81a70319a524ffeaf0625a56

---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/744
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Arne Schwabe <[email protected]...>

src/openvpn/forward.c +2 -0
index 40b7cc4..374ba47 100644
@@ -1256,6 +1256,8 @@
     switch (dco->dco_message_type)
     {
         case OVPN_CMD_DEL_PEER:
+            /* peer is gone, unset ID to prevent more kernel calls */
+            c->c2.tls_multi->dco_peer_id = -1;
             if (dco->dco_del_peer_reason == OVPN_DEL_PEER_REASON_EXPIRED)
             {
                 msg(D_DCO_DEBUG, "%s: received peer expired notification of for peer-id "
#4 lore raw

[Openvpn-devel] [PATCH applied] Re: dco: mark peer as deleted from kernel after receiving CMD_DEL_PEER notification

Trivial enough, and makes sense... not tested further (not that easy to reproduce).

Your patch has been applied to the master branch.

commit 45bef145f3cc39c4c13609866f07b6cf9f8960a6

Author: Antonio Quartulli
Date:   Thu Sep 12 18:53:39 2024 +0200
     dco: mark peer as deleted from kernel after receiving CMD_DEL_PEER notification

     Signed-off-by: Antonio Quartulli <[email protected]...>
     Acked-by: Arne Schwabe <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg29226.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#5 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#2) to the change originally created by ordex. ( http://gerrit.openvpn.net/c/openvpn/+/744?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by plaisthos

Change subject: dco: mark peer as deleted from kernel after receiving CMD_DEL_PEER notification
......................................................................

dco: mark peer as deleted from kernel after receiving CMD_DEL_PEER notification

some extra DCO calls may be made after receiving the DEL_PEER notification (i.e. due to timeout), but this will result in an error message due to the peer having disappeared already.

An extra call might be, for example, an explicit DEL_PEER in the attempt of cleaning the peer state.

For this reason, inform userspace that there is no peer in kernel anymore and prevent errors which may result confusing.

Change-Id Ife50e37cd49d55ec81a70319a524ffeaf0625a56

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg29226.html

---
M src/openvpn/forward.c

1 file changed, 2 insertions(+), 0 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/44/744/2

src/openvpn/forward.c +2 -0
index 40b7cc4..374ba47 100644
@@ -1256,6 +1256,8 @@
     switch (dco->dco_message_type)
     {
         case OVPN_CMD_DEL_PEER:
+            /* peer is gone, unset ID to prevent more kernel calls */
+            c->c2.tls_multi->dco_peer_id = -1;
             if (dco->dco_del_peer_reason == OVPN_DEL_PEER_REASON_EXPIRED)
             {
                 msg(D_DCO_DEBUG, "%s: received peer expired notification of for peer-id "

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/744?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ife50e37cd49d55ec81a70319a524ffeaf0625a56
Gerrit-Change-Number: 744
Gerrit-PatchSet: 2
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newpatchset

#6 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/744?usp=email )

Change subject: dco: mark peer as deleted from kernel after receiving CMD_DEL_PEER notification
......................................................................

dco: mark peer as deleted from kernel after receiving CMD_DEL_PEER notification

some extra DCO calls may be made after receiving the DEL_PEER notification (i.e. due to timeout), but this will result in an error message due to the peer having disappeared already.

An extra call might be, for example, an explicit DEL_PEER in the attempt of cleaning the peer state.

For this reason, inform userspace that there is no peer in kernel anymore and prevent errors which may result confusing.

Change-Id Ife50e37cd49d55ec81a70319a524ffeaf0625a56

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg29226.html

---
M src/openvpn/forward.c

1 file changed, 2 insertions(+), 0 deletions(-)
src/openvpn/forward.c +2 -0
index 40b7cc4..374ba47 100644
@@ -1256,6 +1256,8 @@
     switch (dco->dco_message_type)
     {
         case OVPN_CMD_DEL_PEER:
+            /* peer is gone, unset ID to prevent more kernel calls */
+            c->c2.tls_multi->dco_peer_id = -1;
             if (dco->dco_del_peer_reason == OVPN_DEL_PEER_REASON_EXPIRED)
             {
                 msg(D_DCO_DEBUG, "%s: received peer expired notification of for peer-id "

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/744?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ife50e37cd49d55ec81a70319a524ffeaf0625a56
Gerrit-Change-Number: 744
Gerrit-PatchSet: 2
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged